//
//  HomeButtonView.m
//  JunZeWristband
//
//  Created by Kendama on 2017/8/17.
//  Copyright © 2017年 DT. All rights reserved.
//

#import "HomeButtonView.h"

@implementation HomeButtonView

- (void)masLayoutSubview
{
    __weak UIView *superView = self;
    [self.iconImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(superView.mas_centerY);
        make.left.mas_equalTo(superView.mas_left).with.offset(px1080Width(65));
        make.width.height.mas_equalTo(px1920Height(75));
    }];
    
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(superView.mas_centerY);
        make.left.mas_equalTo(self.iconImageView.mas_right).with.offset(px1080Width(35));
        make.right.mas_equalTo(self.rightImageView.mas_right);
    }];
    
    [self.rightImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(superView.mas_centerY);
        make.right.mas_equalTo(superView.mas_right).with.offset(px1080Width(-65));

    }];
}

- (UIImageView *)iconImageView
{
    if(!_iconImageView)
    {
        UIView *superView = self;
        _iconImageView = [[UIImageView alloc]init];
        [superView addSubview:_iconImageView];
    }
    return _iconImageView;
}
- (UIImageView *)rightImageView
{
    if(!_rightImageView)
    {
        UIView *superView = self;
        _rightImageView = [[UIImageView alloc]init];
        [superView addSubview:_rightImageView];
        _rightImageView.image = [UIImage imageNamed:@"right"];
    }
    return _rightImageView;
}
- (UILabel *)titleLabel
{
    if(!_titleLabel)
    {
        UIView *superView = self;
        _titleLabel = [[UILabel alloc]init];
        [superView addSubview:_titleLabel];
        [_titleLabel setFont:[UIFont systemFontOfSize:15]];
        [_titleLabel setTextColor:[UIColor grayColor]];
    }
    return _titleLabel;
}


@end
